#
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

LOCAL_DIR := $(GET_LOCAL_DIR)

# A library target that contains the trusty NVRAM implementation, without any
# glue to build the app or dependencies to other services. This allows to link
# this module into the unittest app with dependencies mocked out.
MODULE := $(LOCAL_DIR)

MODULE_SRCS += \
	$(LOCAL_DIR)/crypto_boringssl.cpp \
	$(LOCAL_DIR)/nvram_manager.cpp \
	$(LOCAL_DIR)/persistence.cpp

MODULE_CPPFLAGS := -Wall -Werror -Wextra

MODULE_DEPS += \
	external/openssl \
	lib/libc-trusty \
	lib/libstdc++-trusty \
	system/nvram/messages

ifneq ($(NVRAM_LOG_LEVEL),)
GLOBAL_DEFINES += NVRAM_LOG_LEVEL=$(NVRAM_LOG_LEVEL)
endif

ifneq ($(NVRAM_WIPE_STORAGE_SUPPORT),)
GLOBAL_DEFINES += NVRAM_WIPE_STORAGE_SUPPORT=$(NVRAM_WIPE_STORAGE_SUPPORT)
endif

GLOBAL_INCLUDES += $(LOCAL_DIR)/include/

include make/module.mk
